<p class="Paragraph">Returns the specified portion of a string expression (<span style="font-weight:bold;">Mid function</span>), or replaces the portion of a string expression by another string (<span style="font-weight:bold;">Mid statement</span>).</p>
<p class="Paragraph">Mid (Text As String, Start As Integer [, Length As Integer]) or Mid (Text As String, Start As Integer , Length As Integer, Text As String) <help:key-word value="Mid" tag="kw66519_1" xmlns:help="http://openoffice.org/2000/help"/></p>
<p class="Paragraph">Text: Any string expression to be modified.</p>
<p class="Paragraph">Start: Integer expression that indicates the character position within the string where the string portion to be replaced or returned begins.</p>
<p class="Paragraph">Length: Integer expression that returns the number of characters to be replaced or returned.</p>
<p class="Paragraph">If the Length parameter in the <span class="T1">Mid function</span> is omitted, all characters in the string expression from the start position to the end of the string are returned.</p>
<p class="Paragraph">If the Length parameter in the <span class="T1">Mid statement</span> is less than the length of the text to be replaced, it will be reduced to the specified length.</p>
<p class="Paragraph">Text: The string to replace the string expression (<span class="T1">Mid statement</span>).</p>
<p class="P2">Example:</p>
<p class="PropText">Sub ExampleUSDate</p>
<p class="PropText">Dim sInput As String</p>
<p class="PropText">Dim sUS_date As String</p>
<p class="PropText">sInput = InputBox("Please input a date in the international format 'YYYY-MM-DD'")</p>